import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

const routes = [
    {
        path: '/',
        redirect: '/design'
    },
    {
        path: '/design',
        meta: {
            title: 'Activiti-BPMN工具'
        },
        component: () =>
            import ('../components/Design')
    },
]

const router = new Router({
    mode: 'history',
    routes
})
router.beforeEach((to, from, next) => {
    document.title = to.matched[0].meta.title
    next()
})

export default router